package com.korubo.conf;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@Slf4j
@ControllerAdvice
public class GlobalController {

    //拦截的异常可以写Exception
    @ExceptionHandler(value = {ArithmeticException.class})
    public void arithmeticExceptionHandler(Exception e) {
        log.error("全局异常信息：{}", e);
    }
}
